<template>
    <div class="page-skills">
        <h2 class="section-title">我的技能</h2>
        <div class="skills-container">
            <div v-for="(skill, index) in skills" :key="index" class="skill-item">
                <div class="skill-icon">
                    <i :class="skill.icon"></i>
                </div>
                <div class="skill-info">
                    <h3>{{ skill.name }}</h3>
                    <div class="skill-bar">
                        <div class="skill-progress" :style="{ width: skill.level + '%' }"></div>
                    </div>
                    <span class="skill-level">{{ skill.level }}%</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';
const skills = ref([
    { name: 'Vue.js', level: 90, icon: 'fab fa-vuejs' },
    { name: 'JavaScript', level: 85, icon: 'fab fa-js' },
    { name: 'CSS/SCSS', level: 80, icon: 'fab fa-css3-alt' },
    { name: 'Node.js', level: 75, icon: 'fab fa-node-js' },
    { name: 'UI/UX 设计', level: 70, icon: 'fas fa-paint-brush' },
    { name: 'Python', level: 65, icon: 'fab fa-python' }
])
</script>

<style scoped>
.page-skills {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    color: white;
    height: 100%;
    padding: 10px 5%;
    overflow-y: auto;
}

.section-title {
    font-size: 0.2rem;
    margin-bottom: 5px ;
    text-align: center;
    position: relative;
    display: inline-block;
}

.section-title::after {
    position: absolute;
    height: 0.08rem;
    bottom: -0.3rem;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, transparent, #ff9eb5, transparent);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.skill-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.1rem;
    border-radius: 0.45rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 158, 181, 0.3);
}

.skill-icon {
    font-size: 0.5rem;
    margin-right: 0.1rem;
    color: #ff9eb5;
}

.skill-info {
    flex: 1;
}

.skill-info h3 {
    margin: 0 0 0.3rem 0;
    font-size: 0.2rem;
}

.skill-bar {
    height: 0.24rem;
    border-radius: 0.12rem;
    margin: 0.3rem 0;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff9eb5, #ff6b8b);
    border-radius: 4px;
    transition: width 1.5s ease;
}

.skill-level {
    font-size: 0.36rem;
    opacity: 0.8;
}
</style>